<template>
	<div>
	<van-nav-bar
	  title="地址列表"
	  left-text=""
	  right-text='+'
	  @click-left="onClickLeft"
	  left-arrow
	  style="border: none;"
	>
	<template #right>
	  <van-icon name="plus" size="19" @click='bijishdz()'  />
	</template>
	</van-nav-bar>
	
	
	<div class="cumianys" v-for="(item,index) in modifyData" :key="index+''" @click="uodatesj(item)">
	  <div class="sanhang">
	    <p><span>{{item.name}}</span> <span>{{item.phone}}</span> <span>[默认]</span></p>
	    <p><span>{{item.province}}</span> <span>{{item.city}}</span> <span>{{item.district}}</span></p>
		  <p>{{item.address}}</p>
	  </div>
	  <div  class="tubisoys">
		  <van-icon name="arrow" />
	  </div>
	</div>
	
	
	</div>
</template>

<script>
import {showreslist} from '../lib/address.js'
export default{
	data(){
		return{
			modifyData:[]
		}
	},
	created(page=1) {
		this.getList()
	},
	methods:{
		getList(page=1){
			showreslist({page:page}).then(res=>{
							console.log(res)
							this.modifyData=res.data
						})
		},
		onClickLeft() {
			  this.$router.go(-1)
			},	
			bijishdz(){
				this.$router.push({
				  name: "Bianjishdz",
				});
			},
			uodatesj(item){
				this.$router.push({
					name:'Bianjishdz',
					query:{
						id:item
					}
				})
	
			}
	}
}
</script>

<style>
	.cumianys{
		display: flex;
		 width: 100%;
		 justify-content: center;
		 align-items: center;
		 border-bottom: #CCCCCC solid 0.0625rem;
	}
	.sanhang{
		margin-left: 0.8rem;
		width: 82%;
		line-height: 2rem;
		color: #797F87;
		}
	.tubisoys{
		display: inline-block;
		 width: 48%;
		 padding-left: 1%;
		text-align: right;
		margin-right: 1rem;
	}
	.sanhang>p:first-of-type>span:first-of-type,.sanhang>p:first-of-type>span:nth-of-type(3){
		color: #E56200;
		font-size: 16px;
		font-weight:initial;
	}
</style>
